package contest.sweek199;

/**
 * 1529. 灯泡开关 IV
 * @author code_yc
 * @version 1.0
 * @date 2020/7/26 8:22
 */
public class Solution2 {
    public int minFlips(String target) {
        int ans = 0;
        char pre = '0';
        for(int i = 0; i < target.length(); i++) {
            char c = target.charAt(i);
            if(c != pre) ans++;
            pre = c;
        }
        return ans;
    }
}
